package com.matt.foundation.vo.course;

import lombok.Data;

import java.util.Date;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/1/24
 * *******************************
 */
@Data
public class CourseAreaPageVo {
    private String id;
    private String name;
    private String typeName;
    private String auditStaffName;
    private String modifyStaffName;
    private String areaName;
    private String targetObjectName;
    private Long auditDate;
    private Long lastModified;
    private String beginMonth;
    private String endMonth;
    private int status = 0;

    public static CourseAreaPageVo of(Object[] objects) {
        CourseAreaPageVo vo = new CourseAreaPageVo();
        vo.setId(objects[0].toString());
        vo.setName(objects[1] == null ? "" : objects[1].toString());
        vo.setTypeName(objects[2] == null ? "" : objects[2].toString());
        vo.setModifyStaffName(objects[3] == null ? "" : objects[3].toString());
        vo.setAuditDate(objects[4] == null ? 0L : ((Date) objects[4]).getTime());
        vo.setLastModified(objects[5] == null ? 0L : ((Date) objects[5]).getTime());
        vo.setStatus(objects[6] == null ? 0 : Integer.valueOf(objects[6].toString()));
        vo.setAuditStaffName(objects[7] == null ? "" : objects[7].toString());
        vo.setTargetObjectName(objects[8] == null ? "" : objects[8].toString());
        vo.setBeginMonth(objects[9] == null ? "" : objects[9].toString());
        vo.setEndMonth(objects[10] == null ? "" : objects[10].toString());
        return vo;
    }
}
